//
//  UIAlertController+Common.m
//  Music
//
//  Created by GPF on 2017/3/21.
//  Copyright © 2017年 赵红亮. All rights reserved.
//

#import "UIAlertController+Common.h"

@implementation UIAlertController (Common)

+ (UIAlertController *)showAlertController:(NSString *)title message:(NSString *)message style:(UIAlertControllerStyle)style{
    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:style];
    return alertController;
}
- (void)addAction:(NSString *)title style:(UIAlertActionStyle)style handler:(void(^)(UIAlertAction *al))alertAction{
    UIAlertAction *action = [UIAlertAction actionWithTitle:title style:style handler:alertAction];
    [self addAction:action];
}
- (void)presentViewController:(UIViewController *)viewController{
    if (!viewController) {
        viewController = [SettingObject getCurrentViewController];
    }
    [viewController presentViewController:self animated:YES completion:nil];
}
@end
